<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GtkTreeView drag-and-drop</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.74.0">
<link rel="home" href="index.html" title="GTK+ Reference Manual">
<link rel="up" href="TreeWidgetObjects.html" title="Tree, List and Icon Grid Widgets">
<link rel="prev" href="GtkTreeView.html" title="GtkTreeView">
<link rel="next" href="GtkCellView.html" title="GtkCellView">
<meta name="generator" content="GTK-Doc V1.11 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="part" href="gtk.html" title="Part I. GTK+ Overview">
<link rel="part" href="gtkbase.html" title="Part II. GTK+ Core Reference">
<link rel="part" href="gtkobjects.html" title="Part III. GTK+ Widgets and Objects">
<link rel="chapter" href="ch01.html" title="Object Hierarchy">
<link rel="chapter" href="ch02.html" title="Widget Gallery">
<link rel="chapter" href="WindowWidgets.html" title="Windows">
<link rel="chapter" href="DisplayWidgets.html" title="Display Widgets">
<link rel="chapter" href="ButtonWidgets.html" title="Buttons and Toggles">
<link rel="chapter" href="NumericEntry.html" title="Numeric/Text Data Entry">
<link rel="chapter" href="TextWidgetObjects.html" title="Multiline Text Editor">
<link rel="chapter" href="TreeWidgetObjects.html" title="Tree, List and Icon Grid Widgets">
<link rel="chapter" href="MenusAndCombos.html" title="Menus, Combo Box, Toolbar">
<link rel="chapter" href="Actions.html" title="Action-based menus and toolbars">
<link rel="chapter" href="SelectorWidgets.html" title="Selectors (File/Font/Color/Input Devices)">
<link rel="chapter" href="LayoutContainers.html" title="Layout Containers">
<link rel="chapter" href="Ornaments.html" title="Ornaments">
<link rel="chapter" href="ScrollingWidgets.html" title="Scrolling">
<link rel="chapter" href="Printing.html" title="Printing">
<link rel="chapter" href="MiscObjects.html" title="Miscellaneous">
<link rel="chapter" href="AbstractObjects.html" title="Abstract Base Classes">
<link rel="chapter" href="PlugSocket.html" title="Cross-process Embedding">
<link rel="chapter" href="SpecialObjects.html" title="Special-purpose features">
<link rel="chapter" href="RecentDocuments.html" title="Recently Used Documents">
<link rel="chapter" href="Builder.html" title="Interface builder">
<link rel="chapter" href="DeprecatedObjects.html" title="Deprecated">
<link rel="part" href="migrating.html" title="Part IV. Migrating from Previous Versions of GTK+">
<link rel="chapter" href="gtk-migrating-checklist.html" title="Migration Checklist">
<link rel="chapter" href="gtk-migrating-GtkFileChooser.html" title="Migrating from GtkFileSelection to GtkFileChooser">
<link rel="chapter" href="gtk-migrating-GtkAction.html" title="Migrating from old menu and toolbar systems to GtkAction">
<link rel="chapter" href="gtk-migrating-GtkComboBox.html" title="Migrating from GtkOptionMenu and GtkCombo to GtkComboBox and GtkComboBoxEntry">
<link rel="chapter" href="gtk-migrating-GtkIconView.html" title="Migrating from GnomeIconList to GtkIconView">
<link rel="chapter" href="gtk-migrating-GtkAboutDialog.html" title="Migrating from GnomeAbout to GtkAboutDialog">
<link rel="chapter" href="gtk-migrating-GtkColorButton.html" title="Migrating from GnomeColorPicker to GtkColorButton">
<link rel="chapter" href="gtk-migrating-GtkAssistant.html" title="Migrating from GnomeDruid to GtkAssistant">
<link rel="chapter" href="gtk-migrating-GtkRecentChooser.html" title="Migrating from EggRecent to GtkRecentChooser">
<link rel="chapter" href="gtk-migrating-GtkLinkButton.html" title="Migrating from GnomeHRef to GtkLinkButton">
<link rel="chapter" href="gtk-migrating-GtkBuilder.html" title="Migrating from libglade to GtkBuilder">
<link rel="chapter" href="gtk-migrating-tooltips.html" title="Migrating from GtkTooltips to GtkTooltip">
<link rel="part" href="pt05.html" title="Part V. GTK+ Tools">
<link rel="glossary" href="glossary.html" title="Glossary">
<link rel="index" href="api-index-full.html" title="Index of all symbols">
<link rel="index" href="api-index-deprecated.html" title="Index of deprecated symbols">
<link rel="index" href="api-index-2-2.html" title="Index of new symbols in 2.2">
<link rel="index" href="api-index-2-4.html" title="Index of new symbols in 2.4">
<link rel="index" href="api-index-2-6.html" title="Index of new symbols in 2.6">
<link rel="index" href="api-index-2-8.html" title="Index of new symbols in 2.8">
<link rel="index" href="api-index-2-10.html" title="Index of new symbols in 2.10">
<link rel="index" href="api-index-2-12.html" title="Index of new symbols in 2.12">
<link rel="index" href="api-index-2-14.html" title="Index of new symbols in 2.14">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="GtkTreeView.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="TreeWidgetObjects.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GTK+ Reference Manual</th>
<td><a accesskey="n" href="GtkCellView.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#gtk-GtkTreeView-drag-and-drop.synopsis" class="shortcut">Top</a>
                 | 
                <a href="#gtk-GtkTreeView-drag-and-drop.description" class="shortcut">Description</a>
                 | 
                <a href="#gtk-GtkTreeView-drag-and-drop.object-hierarchy" class="shortcut">Object Hierarchy</a>
                 | 
                <a href="#gtk-GtkTreeView-drag-and-drop.implementations" class="shortcut">Known Implementations</a>
</td></tr>
</table>
<div class="refentry" lang="en">
<a name="gtk-GtkTreeView-drag-and-drop"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gtk-GtkTreeView-drag-and-drop.top_of_page"></a>GtkTreeView drag-and-drop</span></h2>
<p>GtkTreeView drag-and-drop — Interfaces for drag-and-drop support in GtkTreeView</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="gtk-GtkTreeView-drag-and-drop.synopsis"></a><h2>Synopsis</h2>
<a name="GtkTreeDragSource"></a><a name="GtkTreeDragDest"></a><pre class="synopsis">

#include &lt;gtk/gtk.h&gt;

                    <a class="link" href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragSource-struct" title="GtkTreeDragSource">GtkTreeDragSource</a>;
                    <a class="link" href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragSourceIface" title="GtkTreeDragSourceIface">GtkTreeDragSourceIface</a>;
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            <a class="link" href="gtk-GtkTreeView-drag-and-drop.html#gtk-tree-drag-source-drag-data-delete" title="gtk_tree_drag_source_drag_data_delete ()">gtk_tree_drag_source_drag_data_delete</a>
                                                        (<a class="link" href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragSource">GtkTreeDragSource</a> *drag_source,
                                                         <a class="link" href="GtkTreeModel.html#GtkTreePath" title="GtkTreePath">GtkTreePath</a> *path);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            <a class="link" href="gtk-GtkTreeView-drag-and-drop.html#gtk-tree-drag-source-drag-data-get" title="gtk_tree_drag_source_drag_data_get ()">gtk_tree_drag_source_drag_data_get</a>  (<a class="link" href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragSource">GtkTreeDragSource</a> *drag_source,
                                                         <a class="link" href="GtkTreeModel.html#GtkTreePath" title="GtkTreePath">GtkTreePath</a> *path,
                                                         <a class="link" href="GtkWidget.html#GtkSelectionData" title="GtkSelectionData">GtkSelectionData</a> *selection_data);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            <a class="link" href="gtk-GtkTreeView-drag-and-drop.html#gtk-tree-drag-source-row-draggable" title="gtk_tree_drag_source_row_draggable ()">gtk_tree_drag_source_row_draggable</a>  (<a class="link" href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragSource">GtkTreeDragSource</a> *drag_source,
                                                         <a class="link" href="GtkTreeModel.html#GtkTreePath" title="GtkTreePath">GtkTreePath</a> *path);
                    <a class="link" href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragDest-struct" title="GtkTreeDragDest">GtkTreeDragDest</a>;
                    <a class="link" href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragDestIface" title="GtkTreeDragDestIface">GtkTreeDragDestIface</a>;
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            <a class="link" href="gtk-GtkTreeView-drag-and-drop.html#gtk-tree-drag-dest-drag-data-received" title="gtk_tree_drag_dest_drag_data_received ()">gtk_tree_drag_dest_drag_data_received</a>
                                                        (<a class="link" href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragDest">GtkTreeDragDest</a> *drag_dest,
                                                         <a class="link" href="GtkTreeModel.html#GtkTreePath" title="GtkTreePath">GtkTreePath</a> *dest,
                                                         <a class="link" href="GtkWidget.html#GtkSelectionData" title="GtkSelectionData">GtkSelectionData</a> *selection_data);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            <a class="link" href="gtk-GtkTreeView-drag-and-drop.html#gtk-tree-drag-dest-row-drop-possible" title="gtk_tree_drag_dest_row_drop_possible ()">gtk_tree_drag_dest_row_drop_possible</a>
                                                        (<a class="link" href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragDest">GtkTreeDragDest</a> *drag_dest,
                                                         <a class="link" href="GtkTreeModel.html#GtkTreePath" title="GtkTreePath">GtkTreePath</a> *dest_path,
                                                         <a class="link" href="GtkWidget.html#GtkSelectionData" title="GtkSelectionData">GtkSelectionData</a> *selection_data);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            <a class="link" href="gtk-GtkTreeView-drag-and-drop.html#gtk-tree-set-row-drag-data" title="gtk_tree_set_row_drag_data ()">gtk_tree_set_row_drag_data</a>          (<a class="link" href="GtkWidget.html#GtkSelectionData" title="GtkSelectionData">GtkSelectionData</a> *selection_data,
                                                         <a class="link" href="GtkTreeModel.html" title="GtkTreeModel">GtkTreeModel</a> *tree_model,
                                                         <a class="link" href="GtkTreeModel.html#GtkTreePath" title="GtkTreePath">GtkTreePath</a> *path);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            <a class="link" href="gtk-GtkTreeView-drag-and-drop.html#gtk-tree-get-row-drag-data" title="gtk_tree_get_row_drag_data ()">gtk_tree_get_row_drag_data</a>          (<a class="link" href="GtkWidget.html#GtkSelectionData" title="GtkSelectionData">GtkSelectionData</a> *selection_data,
                                                         <a class="link" href="GtkTreeModel.html" title="GtkTreeModel">GtkTreeModel</a> **tree_model,
                                                         <a class="link" href="GtkTreeModel.html#GtkTreePath" title="GtkTreePath">GtkTreePath</a> **path);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="gtk-GtkTreeView-drag-and-drop.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
  GInterface
   +----GtkTreeDragSource
</pre>
<pre class="synopsis">
  GInterface
   +----GtkTreeDragDest
</pre>
</div>
<div class="refsect1" lang="en">
<a name="gtk-GtkTreeView-drag-and-drop.implementations"></a><h2>Known Implementations</h2>
<p>
GtkTreeDragSource is implemented by
 <a class="link" href="GtkTreeModelFilter.html" title="GtkTreeModelFilter">GtkTreeModelFilter</a>,  <a class="link" href="GtkTreeModelSort.html" title="GtkTreeModelSort">GtkTreeModelSort</a>,  <a class="link" href="GtkTreeStore.html" title="GtkTreeStore">GtkTreeStore</a> and  <a class="link" href="GtkListStore.html" title="GtkListStore">GtkListStore</a>.</p>
<p>
GtkTreeDragDest is implemented by
 <a class="link" href="GtkTreeStore.html" title="GtkTreeStore">GtkTreeStore</a> and  <a class="link" href="GtkListStore.html" title="GtkListStore">GtkListStore</a>.</p>
</div>
<div class="refsect1" lang="en">
<a name="gtk-GtkTreeView-drag-and-drop.description"></a><h2>Description</h2>
<p>
GTK+ supports Drag-and-Drop in tree views with a high-level and a low-level
API.
</p>
<p>
The low-level API consists of the GTK+ DND API, augmented by some treeview
utility functions: <a class="link" href="GtkTreeView.html#gtk-tree-view-set-drag-dest-row" title="gtk_tree_view_set_drag_dest_row ()"><code class="function">gtk_tree_view_set_drag_dest_row()</code></a>,
<a class="link" href="GtkTreeView.html#gtk-tree-view-get-drag-dest-row" title="gtk_tree_view_get_drag_dest_row ()"><code class="function">gtk_tree_view_get_drag_dest_row()</code></a>, <a class="link" href="GtkTreeView.html#gtk-tree-view-get-dest-row-at-pos" title="gtk_tree_view_get_dest_row_at_pos ()"><code class="function">gtk_tree_view_get_dest_row_at_pos()</code></a>,
<a class="link" href="GtkTreeView.html#gtk-tree-view-create-row-drag-icon" title="gtk_tree_view_create_row_drag_icon ()"><code class="function">gtk_tree_view_create_row_drag_icon()</code></a>, <a class="link" href="gtk-GtkTreeView-drag-and-drop.html#gtk-tree-set-row-drag-data" title="gtk_tree_set_row_drag_data ()"><code class="function">gtk_tree_set_row_drag_data()</code></a> and
<a class="link" href="gtk-GtkTreeView-drag-and-drop.html#gtk-tree-get-row-drag-data" title="gtk_tree_get_row_drag_data ()"><code class="function">gtk_tree_get_row_drag_data()</code></a>. This API leaves a lot of flexibility, but
nothing is done automatically, and implementing advanced features like
hover-to-open-rows or autoscrolling on top of this API is a lot of work.
</p>
<p>
On the other hand, if you write to the high-level API, then all the
bookkeeping of rows is done for you, as well as things like hover-to-open
and auto-scroll, but your models have to implement the
<a class="link" href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragSource"><span class="type">GtkTreeDragSource</span></a> and <a class="link" href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragDest"><span class="type">GtkTreeDragDest</span></a> interfaces.
</p>
</div>
<div class="refsect1" lang="en">
<a name="gtk-GtkTreeView-drag-and-drop.details"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="GtkTreeDragSource-struct"></a><h3>GtkTreeDragSource</h3>
<pre class="programlisting">typedef struct _GtkTreeDragSource GtkTreeDragSource;</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="GtkTreeDragSourceIface"></a><h3>GtkTreeDragSourceIface</h3>
<pre class="programlisting">typedef struct {
  GTypeInterface g_iface;

  /* VTable - not signals */

  gboolean     (* row_draggable)        (GtkTreeDragSource   *drag_source,
                                         GtkTreePath         *path);

  gboolean     (* drag_data_get)        (GtkTreeDragSource   *drag_source,
                                         GtkTreePath         *path,
                                         GtkSelectionData    *selection_data);

  gboolean     (* drag_data_delete)     (GtkTreeDragSource *drag_source,
                                         GtkTreePath       *path);
} GtkTreeDragSourceIface;
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gtk-tree-drag-source-drag-data-delete"></a><h3>gtk_tree_drag_source_drag_data_delete ()</h3>
<pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            gtk_tree_drag_source_drag_data_delete
                                                        (<a class="link" href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragSource">GtkTreeDragSource</a> *drag_source,
                                                         <a class="link" href="GtkTreeModel.html#GtkTreePath" title="GtkTreePath">GtkTreePath</a> *path);</pre>
<p>
Asks the <a class="link" href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragSource"><span class="type">GtkTreeDragSource</span></a> to delete the row at <em class="parameter"><code>path</code></em>, because
it was moved somewhere else via drag-and-drop. Returns <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE--CAPS"
><code class="literal">FALSE</code></a>
if the deletion fails because <em class="parameter"><code>path</code></em> no longer exists, or for
some model-specific reason. Should robustly handle a <em class="parameter"><code>path</code></em> no
longer found in the model!</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>drag_source</code></em> :</span></p></td>
<td> a <a class="link" href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragSource"><span class="type">GtkTreeDragSource</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td>
<td> row that was being dragged
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE--CAPS"
><code class="literal">TRUE</code></a> if the row was successfully deleted
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gtk-tree-drag-source-drag-data-get"></a><h3>gtk_tree_drag_source_drag_data_get ()</h3>
<pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            gtk_tree_drag_source_drag_data_get  (<a class="link" href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragSource">GtkTreeDragSource</a> *drag_source,
                                                         <a class="link" href="GtkTreeModel.html#GtkTreePath" title="GtkTreePath">GtkTreePath</a> *path,
                                                         <a class="link" href="GtkWidget.html#GtkSelectionData" title="GtkSelectionData">GtkSelectionData</a> *selection_data);</pre>
<p>
Asks the <a class="link" href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragSource"><span class="type">GtkTreeDragSource</span></a> to fill in <em class="parameter"><code>selection_data</code></em> with a
representation of the row at <em class="parameter"><code>path</code></em>. <em class="parameter"><code>selection_data-&gt;target</code></em> gives
the required type of the data.  Should robustly handle a <em class="parameter"><code>path</code></em> no
longer found in the model!</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>drag_source</code></em> :</span></p></td>
<td> a <a class="link" href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragSource"><span class="type">GtkTreeDragSource</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td>
<td> row that was dragged
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>selection_data</code></em> :</span></p></td>
<td> a <a class="link" href="GtkWidget.html#GtkSelectionData" title="GtkSelectionData"><span class="type">GtkSelectionData</span></a> to fill with data from the dragged row
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE--CAPS"
><code class="literal">TRUE</code></a> if data of the required type was provided 
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gtk-tree-drag-source-row-draggable"></a><h3>gtk_tree_drag_source_row_draggable ()</h3>
<pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            gtk_tree_drag_source_row_draggable  (<a class="link" href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragSource">GtkTreeDragSource</a> *drag_source,
                                                         <a class="link" href="GtkTreeModel.html#GtkTreePath" title="GtkTreePath">GtkTreePath</a> *path);</pre>
<p>
Asks the <a class="link" href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragSource"><span class="type">GtkTreeDragSource</span></a> whether a particular row can be used as
the source of a DND operation. If the source doesn't implement
this interface, the row is assumed draggable.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>drag_source</code></em> :</span></p></td>
<td> a <a class="link" href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragSource"><span class="type">GtkTreeDragSource</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td>
<td> row on which user is initiating a drag
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE--CAPS"
><code class="literal">TRUE</code></a> if the row can be dragged
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="GtkTreeDragDest-struct"></a><h3>GtkTreeDragDest</h3>
<pre class="programlisting">typedef struct _GtkTreeDragDest GtkTreeDragDest;</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="GtkTreeDragDestIface"></a><h3>GtkTreeDragDestIface</h3>
<pre class="programlisting">typedef struct {
  GTypeInterface g_iface;

  /* VTable - not signals */

  gboolean     (* drag_data_received) (GtkTreeDragDest   *drag_dest,
                                       GtkTreePath       *dest,
                                       GtkSelectionData  *selection_data);

  gboolean     (* row_drop_possible)  (GtkTreeDragDest   *drag_dest,
                                       GtkTreePath       *dest_path,
				       GtkSelectionData  *selection_data);
} GtkTreeDragDestIface;
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gtk-tree-drag-dest-drag-data-received"></a><h3>gtk_tree_drag_dest_drag_data_received ()</h3>
<pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            gtk_tree_drag_dest_drag_data_received
                                                        (<a class="link" href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragDest">GtkTreeDragDest</a> *drag_dest,
                                                         <a class="link" href="GtkTreeModel.html#GtkTreePath" title="GtkTreePath">GtkTreePath</a> *dest,
                                                         <a class="link" href="GtkWidget.html#GtkSelectionData" title="GtkSelectionData">GtkSelectionData</a> *selection_data);</pre>
<p>
Asks the <a class="link" href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragDest"><span class="type">GtkTreeDragDest</span></a> to insert a row before the path <em class="parameter"><code>dest</code></em>,
deriving the contents of the row from <em class="parameter"><code>selection_data</code></em>. If <em class="parameter"><code>dest</code></em> is
outside the tree so that inserting before it is impossible, <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE--CAPS"
><code class="literal">FALSE</code></a>
will be returned. Also, <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE--CAPS"
><code class="literal">FALSE</code></a> may be returned if the new row is
not created for some model-specific reason.  Should robustly handle
a <em class="parameter"><code>dest</code></em> no longer found in the model!</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>drag_dest</code></em> :</span></p></td>
<td> a <a class="link" href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragDest"><span class="type">GtkTreeDragDest</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>dest</code></em> :</span></p></td>
<td> row to drop in front of
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>selection_data</code></em> :</span></p></td>
<td> data to drop
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> whether a new row was created before position <em class="parameter"><code>dest</code></em>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gtk-tree-drag-dest-row-drop-possible"></a><h3>gtk_tree_drag_dest_row_drop_possible ()</h3>
<pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            gtk_tree_drag_dest_row_drop_possible
                                                        (<a class="link" href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragDest">GtkTreeDragDest</a> *drag_dest,
                                                         <a class="link" href="GtkTreeModel.html#GtkTreePath" title="GtkTreePath">GtkTreePath</a> *dest_path,
                                                         <a class="link" href="GtkWidget.html#GtkSelectionData" title="GtkSelectionData">GtkSelectionData</a> *selection_data);</pre>
<p>
Determines whether a drop is possible before the given <em class="parameter"><code>dest_path</code></em>,
at the same depth as <em class="parameter"><code>dest_path</code></em>. i.e., can we drop the data in
<em class="parameter"><code>selection_data</code></em> at that location. <em class="parameter"><code>dest_path</code></em> does not have to
exist; the return value will almost certainly be <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE--CAPS"
><code class="literal">FALSE</code></a> if the
parent of <em class="parameter"><code>dest_path</code></em> doesn't exist, though.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>drag_dest</code></em> :</span></p></td>
<td> a <a class="link" href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragDest"><span class="type">GtkTreeDragDest</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>dest_path</code></em> :</span></p></td>
<td> destination row
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>selection_data</code></em> :</span></p></td>
<td> the data being dragged
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE--CAPS"
><code class="literal">TRUE</code></a> if a drop is possible before <em class="parameter"><code>dest_path</code></em>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gtk-tree-set-row-drag-data"></a><h3>gtk_tree_set_row_drag_data ()</h3>
<pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            gtk_tree_set_row_drag_data          (<a class="link" href="GtkWidget.html#GtkSelectionData" title="GtkSelectionData">GtkSelectionData</a> *selection_data,
                                                         <a class="link" href="GtkTreeModel.html" title="GtkTreeModel">GtkTreeModel</a> *tree_model,
                                                         <a class="link" href="GtkTreeModel.html#GtkTreePath" title="GtkTreePath">GtkTreePath</a> *path);</pre>
<p>
Sets selection data of target type <code class="literal">GTK_TREE_MODEL_ROW</code>. Normally used
in a drag_data_get handler.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>selection_data</code></em> :</span></p></td>
<td> some <a class="link" href="GtkWidget.html#GtkSelectionData" title="GtkSelectionData"><span class="type">GtkSelectionData</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>tree_model</code></em> :</span></p></td>
<td> a <a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td>
<td> a row in <em class="parameter"><code>tree_model</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE--CAPS"
><code class="literal">TRUE</code></a> if the <a class="link" href="GtkWidget.html#GtkSelectionData" title="GtkSelectionData"><span class="type">GtkSelectionData</span></a> had the proper target type to allow us to set a tree row
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gtk-tree-get-row-drag-data"></a><h3>gtk_tree_get_row_drag_data ()</h3>
<pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            gtk_tree_get_row_drag_data          (<a class="link" href="GtkWidget.html#GtkSelectionData" title="GtkSelectionData">GtkSelectionData</a> *selection_data,
                                                         <a class="link" href="GtkTreeModel.html" title="GtkTreeModel">GtkTreeModel</a> **tree_model,
                                                         <a class="link" href="GtkTreeModel.html#GtkTreePath" title="GtkTreePath">GtkTreePath</a> **path);</pre>
<p>
Obtains a <em class="parameter"><code>tree_model</code></em> and <em class="parameter"><code>path</code></em> from selection data of target type
<code class="literal">GTK_TREE_MODEL_ROW</code>. Normally called from a drag_data_received handler.
This function can only be used if <em class="parameter"><code>selection_data</code></em> originates from the same
process that's calling this function, because a pointer to the tree model
is being passed around. If you aren't in the same process, then you'll
get memory corruption. In the <a class="link" href="gtk-GtkTreeView-drag-and-drop.html#GtkTreeDragDest"><span class="type">GtkTreeDragDest</span></a> drag_data_received handler,
you can assume that selection data of type <code class="literal">GTK_TREE_MODEL_ROW</code> is
in from the current process. The returned path must be freed with
<a class="link" href="GtkTreeModel.html#gtk-tree-path-free" title="gtk_tree_path_free ()"><code class="function">gtk_tree_path_free()</code></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>selection_data</code></em> :</span></p></td>
<td> a <a class="link" href="GtkWidget.html#GtkSelectionData" title="GtkSelectionData"><span class="type">GtkSelectionData</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>tree_model</code></em> :</span></p></td>
<td> a <a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td>
<td> row in <em class="parameter"><code>tree_model</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE--CAPS"
><code class="literal">TRUE</code></a> if <em class="parameter"><code>selection_data</code></em> had target type <code class="literal">GTK_TREE_MODEL_ROW</code> and
 is otherwise valid
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.11</div>
</body>
</html>
